home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / GadUtil / Include / libraries / gadutil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-05  |  22.3 KB  |  619 lines

  1. #ifndef LIBRARIES_GADUTIL_H
  2. #define LIBRARIES_GADUTIL_H
  3. /*------------------------------------------------------------------------**
  4. **
  5. **    $VER: gadutil.h 37.10 (28.09.97)
  6. **
  7. **    Filename:    libraries/gadutil.h
  8. **    Version:    37.10
  9. **    Date:        28-Sep-97
  10. **
  11. **    GadUtil definitions, a dynamic gadget layout system.
  12. **
  13. **    © Copyright 1994-1997 by P-O Yliniemi and Staffan Hämälä.
  14. **
  15. **    All Rights Reserved.
  16. **
  17. **------------------------------------------------------------------------*/
  18.  
  19. #ifndef EXEC_TYPES_H
  20. #include <exec/types.h>
  21. #endif
  22.  
  23. #ifndef EXEC_LIBRARIES_H
  24. #include <exec/libraries.h>
  25. #endif
  26.  
  27. #ifndef UTILITY_TAGITEM_H
  28. #include <utility/tagitem.h>
  29. #endif
  30.  
  31. #ifndef INTUITION_INTUITION_H
  32. #include <intuition/intuition.h>
  33. #endif
  34.  
  35. #ifndef LIBRARIES_GADTOOLS_H
  36. #include <libraries/gadtools.h>
  37. #endif
  38.  
  39. /*------------------------------------------------------------------------**
  40. **
  41. ** Extended gadget types available in GadUtil.library.
  42. **
  43. */
  44.  
  45. #define IMAGE_KIND    50
  46. #define LABEL_KIND    51
  47. #define DRAWER_KIND    52
  48. #define FILE_KIND    53
  49. #define BEVELBOX_KIND    54
  50. #define PROGRESS_KIND    55
  51.  
  52. /*-------------------- Reserved GadgetID's - don't use! ------------------**
  53. **
  54. ** GadgetID's are really word sized, but two of these vaules are used by the
  55. ** GU_HelpGadget tag, so don't use -1 (65535), -2 (65534) or -3 (65533) as
  56. ** GadgetID!
  57. **
  58. */
  59.  
  60. #define GADID_RESERVED    0xFFFFFFFF
  61. #define WINTITLE_HELP    0xFFFFFFFE
  62. #define SCRTITLE_HELP    0xFFFFFFFD
  63.  
  64. /*--------------- Minimum recommended sizes for some gadgets -------------*/
  65. #define FILEKIND_WIDTH  20
  66. #define FILEKIND_HEIGHT 14
  67.  
  68. #define DRAWERKIND_WIDTH  20
  69. #define DRAWERKIND_HEIGHT 14
  70.  
  71. /*------------------ Text placement for LABEL_KIND -----------------------**
  72. **
  73. **    ___1_____2_____3___
  74. **    |_____|_____|_____| A    Nine different placements of the text is
  75. **    |_____|_____|_____| B    possible if the size of the box allows it.
  76. **    |_____|_____|_____| C    The flags are the same as for BEVELBOX_KIND
  77. */
  78.  
  79. #define LB_TEXT_TOP    0    /* Place text on line A of the box   */
  80.  
  81. #define LB_TEXT_MIDDLE    1    /* Place text on line B of the box   */
  82.  
  83. #define LB_TEXT_BOTTOM    2    /* Place text on line C of the box   */
  84.  
  85. #define LB_TEXT_CENTER    0    /* Place text in column 2 of the box */
  86.  
  87. #define LB_TEXT_LEFT    4    /* Place text in column 1 of the box */
  88.  
  89. #define LB_TEXT_RIGHT    8    /* Place text in column 3 of the box */
  90.  
  91. /*----------------- Alternatives for text placement flags ----------------*/
  92. #define LB_TEXT_TOP_CENTER    LB_TEXT_TOP|LB_TEXT_CENTER
  93. #define LB_TEXT_TOP_LEFT    LB_TEXT_TOP|LB_TEXT_LEFT
  94. #define LB_TEXT_TOP_RIGHT    LB_TEXT_TOP|LB_TEXT_RIGHT
  95.  
  96. #define LB_TEXT_MIDDLE_CENTER    LB_TEXT_MIDDLE|LB_TEXT_CENTER
  97. #define LB_TEXT_MIDDLE_LEFT    LB_TEXT_MIDDLE|LB_TEXT_LEFT
  98. #define LB_TEXT_MIDDLE_RIGHT    LB_TEXT_MIDDLE|LB_TEXT_RIGHT
  99.  
  100. #define LB_TEXT_BOTTOM_CENTER    LB_TEXT_BOTTOM|LB_TEXT_CENTER
  101. #define LB_TEXT_BOTTOM_LEFT    LB_TEXT_BOTTOM|LB_TEXT_LEFT
  102. #define LB_TEXT_BOTTOM_RIGHT    LB_TEXT_BOTTOM|LB_TEXT_RIGHT
  103.  
  104. /*---------------------- Text shadow placement flags ---------------------*/
  105. #define LB_SHADOW_DR    0    /* Place the shadow at x+1, y+1   */
  106. #define LB_SHADOW_UR    16    /* Place the shadow at x+1, y-1   */
  107. #define LB_SHADOW_DL    32    /* Place the shadow at x-1, y+1   */
  108. #define LB_SHADOW_UL    48    /* Place the shadow at x-1, y-1   */
  109.  
  110. /*------------ Alternatives for text shadow placement flags --------------*/
  111. #define LB_SUNAT_UL    0    /* Place the shadow at x+1, y+1   */
  112. #define LB_SUNAT_DL    16    /* Place the shadow at x+1, y-1   */
  113. #define LB_SUNAT_UR    32    /* Place the shadow at x-1, y+1   */
  114. #define LB_SUNAT_DR    48    /* Place the shadow at x-1, y-1   */
  115.  
  116. #define LB_3DTEXT    64    /* Alternative to GULB_3DText, TRUE   */
  117.  
  118. /*-------------------------- Bevel box frame types -----------------------*/
  119. #define BFT_BUTTON    0    /* Normal button bevel box border */
  120. #define BFT_RIDGE    1    /* STRING_KIND bevel box border   */
  121. #define BFT_DROPBOX    2    /* Icon dropbox type border      */
  122.  
  123. #define BFT_HORIZBAR    10    /* Horizontal shadowed line       */
  124. #define BFT_VERTBAR    11    /* Vertical shadowed line         */
  125.  
  126. /*------------------ Text placement for BEVELBOX_KIND --------------------*/
  127. #define BB_TEXT_ABOVE    0    /* Place bevel box text above the
  128.                  * upper border   ___ Example ___ */
  129.  
  130. #define BB_TEXT_IN    1    /* Place bevel box text centered at
  131.                  * the upper border --- Example --- */
  132.  
  133. #define BB_TEXT_BELOW    2    /* Place bevel box text below the
  134.                  * upper border   ___        ___
  135.                  *                    Example      */
  136.  
  137. #define BB_TEXT_CENTER    0    /* Place the text centered at the
  138.                  * upper border (default)         */
  139.  
  140. #define BB_TEXT_LEFT    4    /* Place the text left adjusted   */
  141.  
  142. #define BB_TEXT_RIGHT    8    /* Place the text right adjusted  */
  143.  
  144. /*--------------- Alternatives to text placement flags -------------------*/
  145. #define BB_TEXT_ABOVE_CENTER    BB_TEXT_ABOVE|BB_TEXT_CENTER
  146. #define BB_TEXT_ABOVE_LEFT    BB_TEXT_ABOVE|BB_TEXT_LEFT
  147. #define BB_TEXT_ABOVE_RIGHT    BB_TEXT_ABOVE|BB_TEXT_RIGHT
  148.  
  149. #define BB_TEXT_IN_CENTER    BB_TEXT_IN|BB_TEXT_CENTER
  150. #define BB_TEXT_IN_LEFT        BB_TEXT_IN|BB_TEXT_LEFT
  151. #define BB_TEXT_IN_RIGHT    BB_TEXT_IN|BB_TEXT_RIGHT
  152.  
  153. #define BB_TEXT_BELOW_CENTER    BB_TEXT_BELOW|BB_TEXT_CENTER
  154. #define BB_TEXT_BELOW_LEFT    BB_TEXT_BELOW|BB_TEXT_LEFT
  155. #define BB_TEXT_BELOW_RIGHT    BB_TEXT_BELOW|BB_TEXT_RIGHT
  156.  
  157. /*-----------------------Text Shadow placement ---------------------------*/
  158. #define BB_SHADOW_DR    0    /* Place the shadow at x+1, y+1   */
  159. #define BB_SHADOW_UR    16    /* Place the shadow at x+1, y-1   */
  160. #define BB_SHADOW_DL    32    /* Place the shadow at x-1, y+1   */
  161. #define BB_SHADOW_UL    48    /* Place the shadow at x-1, y-1   */
  162.  
  163. /*------------------ Alternatives for shadow placement -------------------*/
  164. #define BB_SUNAT_UL    0    /* Place the shadow at x+1, y+1   */
  165. #define BB_SUNAT_DL    16    /* Place the shadow at x+1, y-1   */
  166. #define BB_SUNAT_UR    32    /* Place the shadow at x-1, y+1   */
  167. #define BB_SUNAT_DR    48    /* Place the shadow at x-1, y-1   */
  168.  
  169. #define BB_3DTEXT    64    /* Alternative to GUBB_3DText, TRUE */
  170.  
  171. /*------------------------------------------------------------------------**
  172. **
  173. ** This is the structure that actually holds the definition of a single
  174. ** gadget.  It contains the new layout tags defined below, as well as the
  175. ** normal GadTools tags.  You setup all the gadgets in a window by
  176. ** making an array of this structure and passing it to GU_LayoutGadgetsA().
  177. **
  178. */
  179. struct LayoutGadget
  180. {
  181.     WORD    lg_GadgetID;
  182.     struct    TagItem *lg_LayoutTags;
  183.     struct    TagItem *lg_GadToolsTags;
  184.     struct    Gadget *lg_Gadget;
  185. };
  186.  
  187. /*------------------------------------------------------------------------**
  188. **
  189. ** Structure used to hold the built in strings of a localized program. These
  190. ** strings will be used if we couldn't get a string from the catalog.
  191. **
  192. */
  193. struct AppString
  194. {
  195.     ULONG    as_ID;            /* String ID              */
  196.     STRPTR    as_Str;            /* String pointer          */
  197. };
  198.  
  199. /*------------------------------------------------------------------------**
  200. **
  201. ** GadUtil.library is basically an extension to Gadtools.library.  It adds
  202. ** to GadTools the ability to dynamically layout gadgets according to the
  203. ** positions of other gadgets, font size, locale, etc. The goal in designing
  204. ** this was to create a system so that programmers could easily create a GUI
  205. ** that automatically adjusted to a user's environment.
  206. **
  207. ** Every gadget is now defined as a TagList, there is no more need to make
  208. ** use of the NewGadget structure as this taglist allows you to access all
  209. ** fields used in that structure. An array of the TagLists for all your
  210. ** window's gadgets is then passed to GU_LayoutGadgetsA() and your gadget
  211. ** list is created.
  212. */
  213.  
  214. #define GU_TagBase    TAG_USER + 0x60000
  215.  
  216. /*********** Define which kind of gadget we are going to have. ************/
  217.  
  218. #define GU_GadgetKind    GU_TagBase+1    /* Which kind of gadget to make.  */
  219.  
  220.  
  221. /************************ Gadget width control. ***************************/
  222.  
  223. #define GU_Width    GU_TagBase+20    /* Absolute gadget width.      */
  224.  
  225. #define GU_DupeWidth    GU_TagBase+21    /* Duplicate the width of another
  226.                      * gadget.              */
  227.  
  228. #define GU_AutoWidth    GU_TagBase+22    /* Set width according to length
  229.                      * of text label + ti_Data.       */
  230.  
  231. #define GU_Columns    GU_TagBase+23    /* Set width so that approximately
  232.                      * ti_Data columns will fit.      */
  233.  
  234. #define GU_AddWidth    GU_TagBase+24    /* Add some value to the total
  235.                      * width calculation.          */
  236.  
  237. #define GU_MinWidth    GU_TagBase+25    /* Make sure width is at least this */
  238.  
  239. #define GU_MaxWidth    GU_TagBase+26    /* Make sure width is at most this */
  240.  
  241. #define GU_AddWidChar    GU_TagBase+27    /* Add the width of ti_Data chars
  242.                      *  to the gadget width          */
  243.  
  244. #define GU_FractWidth    GU_TagBase+28    /* Divide / multiply gadget width
  245.                      *  with ti_Data          */
  246.  
  247. /************************* Gadget height control. *************************/
  248.  
  249. #define GU_Height    GU_TagBase+40    /* Absolute gadget height.       */
  250.  
  251. #define GU_DupeHeight    GU_TagBase+41    /* Duplicate the height of another
  252.                      * gadget.              */
  253.  
  254. #define GU_AutoHeight    GU_TagBase+42    /* Set height according to height
  255.                      * of text font + ti_Data.      */
  256.  
  257. #define GU_HeightFactor    GU_TagBase+43    /* Make the gadget height a
  258.                      * multiple of the font height.      */
  259.  
  260. #define GU_AddHeight    GU_TagBase+44    /* Add some value to the total
  261.                      * height calculation.          */
  262.  
  263. #define GU_MinHeight    GU_TagBase+45    /* Make sure height is at least this */
  264.  
  265. #define GU_MaxHeight    GU_TagBase+46    /* Make sure height is at most this */
  266.  
  267. #define GU_AddHeiLines    GU_TagBase+47    /* Add the height of ti_Data lines
  268.                      *  to the gadget height      */
  269.  
  270. #define GU_FractHeight    GU_TagBase+48    /* Divide / multiply gadget height
  271.                      *  with ti_Data          */
  272.  
  273. /************************* Gadget top edge control. ***********************/
  274.  
  275. #define GU_Top        GU_TagBase+60    /* Absolute top edge.          */
  276.  
  277. #define GU_TopRel    GU_TagBase+61    /* Top edge relative to bottom
  278.                      * edge of another gadget.      */
  279.  
  280. #define GU_AddTop    GU_TagBase+62    /* Add some value to the final
  281.                      * top edge calculation.      */
  282.  
  283. #define GU_AlignTop    GU_TagBase+63    /* Align top edge of gadget with
  284.                      * top edge of another gadget.      */
  285.  
  286. #define GU_AdjustTop    GU_TagBase+64    /* Add the height of the text font
  287.                      * + ti_Data to the top edge.      */
  288.  
  289. #define GU_AddTopLines    GU_TagBase+65    /* Add the height of ti_Data lines
  290.                      * to the top edge.          */
  291.  
  292. /*********************** Gadget bottom edge control. **********************/
  293.  
  294. #define GU_Bottom    GU_TagBase+80    /* Absolute bottom edge.      */
  295.  
  296. #define GU_BottomRel    GU_TagBase+81    /* Bottom edge relative to top
  297.                      * edge of another gadget.      */
  298.  
  299. #define GU_AddBottom    GU_TagBase+82    /* Add some value to the final
  300.                      * bottom edge calculation.      */
  301.  
  302. #define GU_AlignBottom    GU_TagBase+83    /* Align bottom edge of gadget with
  303.                      * bottom edge of another gadget. */
  304.  
  305. #define GU_AdjustBottom    GU_TagBase+84    /* Subtract the height of the text
  306.                      * font + ti_Data from the top edge */
  307.  
  308. /********************** Gadget left edge control. *************************/
  309.  
  310. #define GU_Left        GU_TagBase+100    /* Absolute left edge.          */
  311.  
  312. #define GU_LeftRel    GU_TagBase+101    /* Left edge relative to right
  313.                      * edge of another gadget.      */
  314.  
  315. #define GU_AddLeft    GU_TagBase+102    /* Add some value to the final
  316.                      * left edge calculation.      */
  317.  
  318. #define GU_AlignLeft    GU_TagBase+103    /* Align left edge of gadget with
  319.                      * left edge of another gadget.      */
  320.  
  321. #define GU_AdjustLeft    GU_TagBase+104    /* Add the width of the text label
  322.                      * + ti_Data to the left edge.      */
  323.  
  324. #define GU_AddLeftChar    GU_TagBase+105    /* Add length of ti_Data characters
  325.                      * to the left edge.          */
  326.  
  327. /********************** Gadget right edge control. ************************/
  328.  
  329. #define GU_Right    GU_TagBase+120    /* Absolute right edge.          */
  330.  
  331. #define GU_RightRel    GU_TagBase+121    /* Right edge relative to left
  332.                      * edge of another gadget.      */
  333.  
  334. #define GU_AddRight    GU_TagBase+122    /* Add some value to the final
  335.                      * right edge calculation.      */
  336.  
  337. #define GU_AlignRight    GU_TagBase+123    /* Align right edge of gadget with
  338.                      * right edge of another gadget.  */
  339.  
  340. #define GU_AdjustRight    GU_TagBase+124    /* Subtract the width of the text
  341.                      * label + ti_Data from the left edge */
  342.  
  343. /******************************* Other tags *******************************/
  344.  
  345. #define GU_ToggleSelect    GU_TagBase+150    /* Create a toggle-select gadget -
  346.                      * only BUTTON_KIND & IMAGE_KIND  */
  347.  
  348. #define GU_Selected    GU_TagBase+151    /* Set default state of toggle-
  349.                      * select gadget          */
  350.  
  351. #define GU_HelpGadget    GU_TagBase+152    /* Gadget ID of a TEXT_KIND gadget that
  352.                      * will show a short help text */
  353.  
  354. #define GU_HelpText    GU_TagBase+153    /* Pointer to the text to be shown in
  355.                      * the help gadget          */
  356.  
  357. #define GU_LocaleHelp    GU_TagBase+154    /* Localized version of GU_HelpText
  358.                      * ti_Data of this tag is the string ID */
  359.  
  360. /********* Access to the other fields of the NewGadget structure **********/
  361.  
  362. #define GU_GadgetText    GU_TagBase+160    /* Gadget label.          */
  363.  
  364. #define GU_TextAttr    GU_TagBase+161    /* Desired font for gadget label. */
  365.  
  366. #define GU_Flags    GU_TagBase+162    /* Gadget flags.          */
  367.  
  368. #define GU_UserData    GU_TagBase+163    /* Gadget UserData.          */
  369.  
  370. #define GU_LocaleText    GU_TagBase+164    /* Gadget label taken from a locale. */
  371.  
  372. /*************** Tags to store some of the calculated values **************/
  373.  
  374. #define GU_StoreLeft    GU_TagBase+170    /* Store the gadget's left position */
  375. #define GU_StoreTop    GU_TagBase+171    /* Store the gadget's top position */
  376. #define GU_StoreWidth    GU_TagBase+172    /* Store the gadget's width      */
  377. #define GU_StoreHeight    GU_TagBase+173    /* Store the gadget's height      */
  378. #define GU_StoreRight    GU_TagBase+174    /* Store the gadget's right position */
  379. #define GU_StoreBottom    GU_TagBase+175    /* Store the gadget's bottom position */
  380.  
  381. /*************** Tags for GadUtil's extended gadget kinds. *****************/
  382.  
  383. /*---------------------------- IMAGE_KIND tags ---------------------------*/
  384. #define GUIM_Image    GU_TagBase+200    /* Image structure for an image
  385.                      * gadget.              */
  386.  
  387. #define GUIM_ReadOnly    GU_TagBase+201    /* TRUE if read-only.          */
  388.  
  389. #define GUIM_SelectImg    GU_TagBase+202    /* Selected image for IMAGE_KIND
  390.                      * gadgets              */
  391.  
  392. #define GUIM_BOOPSILook    GU_TagBase+203    /* Render selected image background
  393.                      * with the fillpen (default = TRUE) */
  394.                      
  395. /*------------------------- BEVELBOX_KIND tags ---------------------------*/
  396. #define GUBB_Recessed    GU_TagBase+220    /* TRUE for a recessed bevel box  */
  397.  
  398. #define GUBB_FrameType    GU_TagBase+221    /* Frame type for bevel box      */
  399.  
  400. #define GUBB_TextColor    GU_TagBase+222    /* Color of the title text      */
  401.  
  402. #define GUBB_TextPen    GU_TagBase+223    /* Pen to print title text with -
  403.                      *  overrides GUBB_TextColor      */
  404.  
  405. #define GUBB_Flags    GU_TagBase+224    /* Text placement flags          */
  406.  
  407. #define GUBB_3DText    GU_TagBase+225    /* Tag to enable 3D text (shadow)
  408.                      *  Not needed if GUBB_ShadowColor
  409.                      *  or GUBB_ShadowPen is used      */
  410.  
  411. #define GUBB_ShadowColor GU_TagBase+226 /* Color of the title text's shadow */
  412.  
  413. #define GUBB_ShadowPen    GU_TagBase+227    /* Pen to print the text's shadow
  414.                      *  with - overrides GUBB_ShadowColor */
  415.  
  416. /*-------------------------- LABEL_KIND tags -----------------------------*/
  417. #define GULB_TextColor    GU_TagBase+222    /* Color of the text          */
  418.  
  419. #define GULB_TextPen    GU_TagBase+223    /* Pen to print text with -
  420.                      *  overrides GULB_TextColor      */
  421.  
  422. #define GULB_Flags    GU_TagBase+224    /* Text placement flags          */
  423.  
  424. #define GULB_3DText    GU_TagBase+225    /* Tag to enable 3D text (shadow)
  425.                      *  Not needed if GULB_ShadowColor
  426.                      *  or GULB_ShadowPen is used      */
  427.  
  428. #define GULB_ShadowColor GU_TagBase+226    /* Color of the text's shadow      */
  429.  
  430. #define GULB_ShadowPen    GU_TagBase+227    /* Pen to print the text's shadow
  431.                      *  with - overrides GULB_ShadowColor */
  432.  
  433. /*------------------------- PROGRESS_KIND tags ---------------------------*/
  434. #define GUPR_FillColor    GU_TagBase+240    /* Color of filled part of indicator */
  435.  
  436. #define GUPR_FillPen    GU_TagBase+241    /* Pen to fill the indicator with
  437.                      *  - overrides GUPR_FillColor      */
  438.  
  439. #define GUPR_BackColor    GU_TagBase+242    /* Color of the background of the
  440.                      *  indicator              */
  441.  
  442. #define GUPR_BackPen    GU_TagBase+243    /* Pen to use for the indocator's
  443.                      *  background - overrides
  444.                      *  GUPR_BackColor          */
  445.  
  446. #define GUPR_Current    GU_TagBase+244    /* Current value of the indicator */
  447.  
  448. #define GUPR_Total    GU_TagBase+245    /* Total value for the indicator  */
  449.  
  450. /************** Tags passed directly to GU_LayoutGadgetsA(). **************/
  451.  
  452. #define GU_RightExtreme    GU_TagBase+500    /* ti_Data is a pointer to a LONG
  453.                      * that is used to store the right-
  454.                      * most point that a gadget
  455.                      * will exist in.          */
  456.  
  457. #define GU_LowerExtreme    GU_TagBase+501    /* ti_Data is a pointer to a LONG
  458.                      * that is used to store the lower-
  459.                      * most point that a gadget will
  460.                      * exist in.              */
  461.  
  462. #define GU_Catalog    GU_TagBase+502    /* Indicates locale for the gadgets. */
  463.  
  464.  
  465. #define GU_DefTextAttr    GU_TagBase+503    /* Specifies a default font for use
  466.                      * with all gadgets, can still be
  467.                      * over-ridden with GU_TextAttr.  */
  468.  
  469. #define GU_AppStrings    GU_TagBase+504    /* Application string table w/IDs. */
  470.  
  471. #define GU_BorderLeft    GU_TagBase+505    /* Size of window left border.      */
  472.  
  473. #define GU_BorderTop    GU_TagBase+506    /* Size of window top border.      */
  474.  
  475. #define GU_NoCreate     GU_TagBase+507    /* Don't actually create the gadgets. */
  476.  
  477. #define GU_MinimumIDCMP GU_TagBase+508    /* Minimum required IDCMP, so that
  478.                      *  all gadgets will work      */
  479.  
  480. #define GU_DefWTitle    GU_TagBase+509    /* Text to show in window title when
  481.                      *  pointer is outside a gadget with
  482.                      *  help text              */
  483.  
  484. #define GU_DefLocWTitle    GU_TagBase+510    /* Localized default window title */
  485.  
  486. #define GU_DefSTitle    GU_TagBase+511    /* Text to show in screen title when
  487.                      *  pointer is outside a gadget with
  488.                      *  help text              */
  489.  
  490. #define GU_DefLocSTitle    GU_TagBase+512    /* Localized default screen title */
  491.  
  492. #define GU_DefHelpText    GU_TagBase+513    /* Text to show in any gadget used to
  493.                      *  display help text when pointer is
  494.                      *  outside a gadget with help text */
  495.  
  496. #define GU_DefLocHelpText GU_TagBase+514 /* Localized default help text      */
  497.  
  498. /***************************** Hotkey tags ********************************/
  499.  
  500. #define GU_Hotkey    GU_TagBase+300    /* Hotkey for gadget (VANILLAKEY) */
  501.  
  502. /********************* Boolean flags for hotkey code **********************/
  503.  
  504. #define GU_HotkeyCase    GU_TagBase+301    /* TRUE for a case-sensitive hotkey */
  505. #define GU_LabelHotkey    GU_TagBase+302    /* TRUE = get hotkey code from label */
  506. #define GU_RawKey    GU_TagBase+303    /* TRUE if hotkey is a RAWKEY code */
  507.  
  508. /*********************** Constants for hotkey support *********************/
  509.  
  510. #define GADUSERMAGIC    0x1122        /* Identification for structure that
  511.                      * the gadgets UserData points to */
  512.  
  513. /******************* Public bit numbers for gu_Flags **********************/
  514.  
  515. #define GU_HOTKEYCASE    0        /* Hoykey is case-sensitive      */
  516. #define GU_RAWKEY    2        /* gu_Code is a RAWKEY code      */
  517.  
  518. #define GU_HOTKEYCASEMASK 1<<GU_HOTKEYCASE /* Mask for GU_HOTKEYCASE bit  */
  519. #define GU_RAWKEYMASK      1<<GU_RAWKEY       /* Mask for GU_RAWKEY bit      */
  520.  
  521. /************** Structure the gadget's UserData points to ******************
  522. *
  523. * This structure is the public part of the allocated data structure for
  524. * hotkeys and IMAGE_KIND gadgets (including FILE_KIND and DRAWER_KIND).
  525. *
  526. * This structure should be considered READ ONLY. The only fields you may
  527. * change is the gu_Code and gu_Flags fields.
  528. *
  529. * DO NOT WRITE ANYTHING BEYOND THIS STRUCTURE WITHOUT ALLOCATING MEMORY FIRST
  530. *
  531. */
  532.  
  533. struct GU_Public
  534. {
  535.     UWORD    gu_Magic;    /* Identification word for structure      */
  536.     ULONG    gu_GadFlags;    /* Flags for GENERIC kind GadUtil gadgets */
  537.     UBYTE    gu_Flags;    /* Flags for the hotkey type          */
  538.     UBYTE    gu_Code;    /* VANILLA or RAWKEY code to react on      */
  539.     WORD    gu_Active;    /* Active entry for some gadget kinds      */
  540.     WORD    gu_MaxVal;    /* Maximum value for some gadgets      */
  541.     WORD    gu_MinVal;    /* Minimum value for some gadgets      */
  542.     ULONG    gu_GadgetType;    /* Gadget type that was created          */
  543.     struct    Gadget *gu_HelpGadget;    /* Pointer to gadget for help text*/
  544.     STRPTR    gu_HelpText;    /* The help text for this gadget      */
  545. };
  546.  
  547. /*------------------------------------------------------------------------**
  548. **                  Library base                  **
  549. **------------------------------------------------------------------------*/
  550.  
  551. struct GadUtilBase
  552. {
  553.         struct    Library LibNode;
  554.         UBYTE   gub_Flags;        /* Private!              */
  555.     UBYTE    gub_Pad;        /* Private!              */
  556.  
  557.     struct    Library *GadToolsBase;    /* The following library bases      */
  558.     struct    GfxBase    *GfxBase;    /* may be read and used by your      */
  559.     struct    IntuitionBase *IntuitionBase;    /* program          */
  560.     struct    Library *LocaleBase;    /* LocaleBase may be NULL!      */
  561.     struct    Library *UtilityBase;
  562.     struct    Library *DiskFontBase;    /* DiskFontBase may be NULL!      */
  563.     LONG    gub_SegList;        /* Private!              */
  564. };
  565.  
  566. #define GADUTILNAME     "gadutil.library"
  567. #define GADUTIL_VER    37
  568. #define    GADUTIL_REV    10
  569.  
  570. /*------------------------------------------------------------------------**
  571. **                  BevelBox structure              **
  572. **------------------------------------------------------------------------*/
  573. struct BBoxData
  574. {
  575.     UWORD    bbd_XPos;         /* X position of box          */
  576.     UWORD    bbd_YPos;         /* Y position of box          */
  577.     UWORD    bbd_Width;        /* Width of box              */
  578.     UWORD    bbd_Height;        /* Height of box          */
  579.  
  580.     UWORD    bbd_LeftEdge;        /* Left edge of text          */
  581.     UWORD    bbd_TopEdge;        /* Top edge of text          */
  582.     UWORD    bbd_TextWidth;        /* Pixel width of text          */
  583.  
  584.     struct    TextAttr *bbd_TextFont; /* Font to print text with      */
  585.     STRPTR    bbd_Text;        /* Text to display          */
  586.         
  587.     UBYTE    bbd_FrontPen;        /* Text color              */
  588.     UBYTE    bbd_Flags;        /* Text placement flags          */
  589.     UBYTE    bbd_Recessed;        /* Recessed frame          */
  590.     UBYTE    bbd_FrameType;        /* Type of box frame          */
  591.     UBYTE    bbd_ShadowPen;             /* Shadow color              */
  592.     UBYTE    bbd_Reserved1;        /* No use in v36.53 - reserved!      */
  593.     struct    Gadget *bbd_HelpGadget;    /* Pointer to gadget for help text*/
  594.     STRPTR    bbd_HelpText;        /* The help text for this gadget  */
  595. };
  596.  
  597. /*------------------------------------------------------------------------**
  598. **              ProgressIndicator structure              **
  599. **------------------------------------------------------------------------*/
  600.  
  601. struct ProgressGad
  602. {
  603.     UWORD    pg_XPos;        /* X pos of box around gadget      */
  604.     UWORD    pg_YPos;        /* Y pos of box around gadget      */
  605.     UWORD    pg_Width;        /* Width of box around gadget      */
  606.     UWORD    pg_Height;        /* Height of box around gadget      */
  607.     ULONG    pg_Current;        /* Current value of indicator      */
  608.     ULONG    pg_Total;        /* Total value of indicator      */
  609.     UBYTE    pg_FillColor;        /* Color of upto current value      */
  610.     UBYTE    pg_BackColor;        /* Color from current to end      */
  611.     UBYTE    pg_Flags;        /* Flags              */
  612.     UBYTE    pg_reserved1;
  613.     UWORD    pg_XFilledTo;        /* Initialized to pg_XPos + 4      */
  614.     struct    Gadget *pg_HelpGadget;    /* Pointer to gadget for help text*/
  615.     STRPTR    pg_HelpText;        /* The help text for this gadget  */
  616. };
  617.  
  618. #endif /* LIBRARIES_GADUTIL_H */
  619.